%{
    _ACCOUNT_LIST = models.accounts.AccountConstant.DIC_ACCOUNT_LIST_NAME;
    _ALL_USERS = models.security.utils.SecurityConstant.DIC_ALL_USER_LIST_NAME;
}%
 #{extends 'main.html'/}
         <div class="row wrapper white-bg page-heading">
      <!--   <div class="wrapper wrapper-content animated fadeInRight"> -->
            <div class="row">
                <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>中继号码信息</h5>
                        <div class="ibox-tools btn-group">
                          #{f.button '查询',href:'javascript:query();',class:'btn btn-primary' /}
                          #{f.button '新增',href:@resource.TrunkNos.add(),class:'btn  btn-info',actionCode:'700002001' /}
                           
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="row search-box">
                              #{form @resource.TrunkNos.index(),method:'GET',id:'queryForm', class:'form-horizontal search-form'}
                              <div class="form-group form-inline col-md-4">
                                #{q.text_field 'query.trunkNo',label:'号码'/}
                              </div>
                              
                              <div class="form-group form-inline col-md-4">
                              <label>所属企业：</label>
                                #{q.select 'query.accountId',blank:'true',blankTitle:'全部',dicName:_ACCOUNT_LIST,value:params['query.accountId']/}
                         
                              </div> 
                              #{/form}
                        </div>

                    <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover dataTables-example" >
                    <thead>
                    <tr>
                        <th>号码</th>
                        <th>所属企业</th>
                        <th>创建时间</th>
                        <th>操作人</th>
                        <th>更新时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    #{list items:rs?.results,as:'vo'}
                        <tr>
                            <td>${vo?.trunkNo}</td>
                            <td>#{f.dicValue _ACCOUNT_LIST,key:vo?.accountId /}</td>
                            <td>${vo?.createdAt?.format('yyyy-MM-dd HH:mm:ss')}</td>
                            <td>#{f.dicValue _ALL_USERS,key:vo?.operatorId /}</td>
                            <td>${vo?.updatedAt?.format('yyyy-MM-dd HH:mm:ss')}</td>
                           
                            <td>
                            #{f.link_to '查看','data-url':@resource.TrunkNos.show(vo?.id),modal:'true',class:'fa fa-search','data-func':'showDetail','data-toggle':'modal', 'data-target':'#mainDialog',role:'button',actionCode:'700002004'/}
                            #{f.link_to '编辑',href:@resource.TrunkNos.edit(vo?.id),class:'fa fa-edit',actionCode:'700002002'/}
                            #{f.link_to '删除',href:@resource.TrunkNos.destroy(vo?.id),class:'fa fa-trash-o',method:'DELETE',actionCode:'700002003'  /}
                            
                            </td>
                        </tr>
                    #{/list}
                    #{else}
                        <tr class="empty-line"><td colspan="10">暂无记录</td></tr>
                    #{/else}
                       </tbody>
                    </table>
                  #{if rs?.pager}
                        #{f.pagination pager:rs?.pager,url:'/trunkNos' /}
                 #{/if}
                        </div>

                    </div>
                </div>
            </div>
            </div>
        </div>
     <script type="text/javascript">
     function query(){
         $('#queryForm').submit();
     }
     
     </script>  